/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.st.entity;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

import java.math.BigDecimal;

/**
 * 产品档案Entity
 * @author HOHD
 * @version 2020-12-23
 */
@Table(name="st_formula", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="material_name", attrName="materialName", label="原料名称", queryType=QueryType.LIKE),
		@Column(name="element_value", attrName="elementValue", label="每公斤产品成分值"),
		@Column(name="unit", attrName="unit", label="国际单位"),
		@Column(name="remarks", attrName="remarks", label="备注", queryType=QueryType.LIKE),
		@Column(name="product_id", attrName="productId.id", label="产品id"),
	}, orderBy="a.id ASC"
)
public class StFormula extends DataEntity<StFormula> {
	
	private static final long serialVersionUID = 1L;
	private String materialName;		// 原料名称
	private BigDecimal elementValue;		// 每公斤产品成分值
	private String unit;		// 国际单位
	private StProductRecord productId;		// 产品id 父类
	
	public StFormula() {
		this(null);
	}


	public StFormula(StProductRecord productId){
		this.productId = productId;
	}
	
	@Length(min=0, max=20, message="原料名称长度不能超过 20 个字符")
	public String getMaterialName() {
		return materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}
	
	public BigDecimal getElementValue() {
		return elementValue;
	}

	public void setElementValue(BigDecimal elementValue) {
		this.elementValue = elementValue;
	}
	
	@Length(min=0, max=36, message="国际单位长度不能超过 36 个字符")
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
	
	@Length(min=0, max=36, message="产品id长度不能超过 36 个字符")
	public StProductRecord getProductId() {
		return productId;
	}

	public void setProductId(StProductRecord productId) {
		this.productId = productId;
	}
	
}